package com.macro.mall.portal.service;

import com.macro.mall.portal.dto.OssCallbackResult;
import com.macro.mall.portal.dto.OssPolicyResult;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;

/**
 * Oss对象存储管理Service
 * Created by macro on 2018/5/17.
 */
public interface OssService {

    /**
     * 上传文件
     * @param file 上传的文件
     * @return 可访问的路径
     */
    String upload(MultipartFile file) throws Exception;

    /**
     * Oss上传策略生成
     */
    OssPolicyResult policy();
    /**
     * Oss上传成功回调
     */
    OssCallbackResult callback(HttpServletRequest request);


}
